package com.pbking.facebook.delegates.fbml
{
	import com.pbking.facebook.Facebook;
	import com.pbking.facebook.FacebookSessionType;
	import com.pbking.facebook.delegates.FacebookDelegate;
	
	/**
	 * delegate for calling fbml.refreshImgSrc.  
	 * 
	 * @author sol wu
	 */
	public class RefreshImgSrcDelegate extends FacebookDelegate
	{			
		/**
		 * @param url - The absolute URL from which to refresh the image.
		 */
		public function RefreshImgSrcDelegate(facebook:Facebook, url:String)
		{
			super(facebook);
			
			// although wiki said this method does not require sessionkey, emperical test shows that desktop app requires session_key.  Error 104 is returned if session_key is not supplied.			
			if (FacebookSessionType.WEB == facebook.sessionType) {
				fbCall.useSession = false;
			}
			
			if (url != "") { fbCall.setRequestArgument("url", url); }
			fbCall.post("facebook.fbml.refreshRefUrl");
		}

	}
}